package com.nbjtjc.safe.mapper.cost;

import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.nbjtjc.safe.model.cost.CostAccountRecord;
import com.nbjtjc.util.MyMapper;

@Mapper
public interface CostAccountRecordMapper extends MyMapper<CostAccountRecord> {
	List<CostAccountRecord> findByRegId(@Param("regId")int regId);
	
	
	@Select("select id from cost_account_record where cancel = 0 and account_reg_id = #{regId}")
	ArrayList<Integer> findIdByRegId(@Param("regId") int regId);

	@Update("update cost_account_record set cancel = 1 where account_reg_id = #{regId}")
	int cancelByRegId(@Param("regId") int regId);
	
	
}